﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GuiClient
{
    public partial class UserControlManHinhRutTien : UserControl
    {
        public UserControlManHinhRutTien()
        {
            InitializeComponent();
        }

        public delegate void XacNhanGiaoDich(Double money);
        public event XacNhanGiaoDich XacNhanGiaoDichEvent;

        public delegate void Thoat();
        public event Thoat ThoatEvent;

        private void buttonXacNhanGiaoDich_Click(object sender, EventArgs e)
        {
            bool choose = false;
            Double money = -2;
            if (this.radioButton1.Checked)
            {
                money = 100000;
            }
            else if (this.radioButton2.Checked)
            {
                money = 200000;
            }
            else if (this.radioButton3.Checked)
            {
                money = 500000;
            }
            else if (this.radioButton4.Checked)
            {
                money = 1000000;
            }
            else if (this.radioButton5.Checked)
            {
                money = 2000000;
            }
            else if(this.radioButton6.Checked)
            {
                money = 4000000;
            }
            else if (this.radioButton7.Checked)
            {
                money = 5000000;
            }
            else if (this.radioButton8.Checked)
            {
                money = -1;
            }

            if (money == -2)
            {
                MessageBox.Show("Bạn chưa chọn mức tiền !");
            }
            else
            {
                if (XacNhanGiaoDichEvent != null)
                {
                    XacNhanGiaoDichEvent(money);
                }
            }

            
        }

        private void buttonThoat_Click(object sender, EventArgs e)
        {
            if (ThoatEvent != null)
            {
                ThoatEvent();
            }
        }

        private void label3_Click(object sender, EventArgs e)
        {

        }

        private void UserControlManHinhRutTien_Load(object sender, EventArgs e)
        {

        }
    }
}
